When an object-oriented program runs, a function thereof may be implemented by created objects, and each created object may occupy certain memory resources. When a certain object is no longer needed, the object may be cleared to release the memory resources occupied by the object. This process may be referred to as a Garbage Collection (GC) process.
By taking a Java™ Virtual Machine (JVM) as an example, objects of all applications deployed in a same JVM are all stored in a Java Heap of the memory (heap memory). When garbage collection is performed on the Java heap, the JVM may suspend threads of application programs except a program that executes the garbage collection operation, and then garbage collection is performed on the whole heap memory to release memory space occupied by unavailable objects.
In the process of garbage collection, the running of programs, except the program that executes the garbage collection operation, is suspended. Therefore, the programs in the JVM cannot provide external services. For some application programs written in languages other than Java™, there may similarly also be a problem that the programs in the virtual machine cannot provide external services during garbage collection.